package com.victualler.product.customer.controller.impl;

import com.victualler.core.base.controller.impl.BaseRestControllerImpl;
import com.victualler.product.customer.controller.CustomerAddressController;
import com.victualler.product.customer.entity.CustomerAddressDao;
import com.victualler.product.customer.repository.CustomerAddressQueryRepository;
import com.victualler.product.customer.repository.CustomerAddressRepository;
import com.victualler.product.customer.service.CustomerAddressService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: Guoshichang
 * @discription:    
 */
@RestController
@RequestMapping("/product/customer/address")
public class CustomerAddressControllerImpl extends BaseRestControllerImpl<CustomerAddressDao,CustomerAddressRepository,CustomerAddressQueryRepository,CustomerAddressService> implements CustomerAddressController {
    /**
     * @author Guoshichang
     * @since 15:59 on 2018/11/15.
     * @param parentId
     * @return List
     * @Function  获取用户下所有地址信息
     */
    @RequestMapping("/getByParentId/{parentId}")
    public List<CustomerAddressDao> getByParentId(@PathVariable("parentId") Long parentId) {
        return this.baseService.getByParentId(parentId);
    }
}
